<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">
<script>
    (function () {
        if ('') {
            if (prompt('请输入文章密码') !== '') {
                alert('密码错误！');
                if (history.length === 1) {
                    location.replace("https://google.com"); // 这里替换成你的首页
                } else {
                    history.back();
                }
            }
        }
    })();
</script>








<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="公众号,">










<meta name="description" content="苏生不惑第179 篇原创文章，将本公众号设为星标，第一时间看最新文章。  国庆假期第3天，你在家宅还是在外出游玩呢，如果在家无聊推荐几部经典电影给你看看。 这里用 Python 抓取知乎上的电影话题https://www.zhihu.com/topic/19550429/top-answers和影视话题https://www.zhihu.com/topic/19554706/top-answer">
<meta name="keywords" content="公众号">
<meta property="og:type" content="article">
<meta property="og:title" content="Python抓取知乎电影话题下万千网友推荐的电影，这个国庆节不愁没电影看了">
<meta property="og:url" content="http://yoursite.com/2020/10/16/Python抓取知乎电影话题下万千网友推荐的电影，这个国庆节不愁没电影看了/index.html">
<meta property="og:site_name" content="苏生不惑的博客">
<meta property="og:description" content="苏生不惑第179 篇原创文章，将本公众号设为星标，第一时间看最新文章。  国庆假期第3天，你在家宅还是在外出游玩呢，如果在家无聊推荐几部经典电影给你看看。 这里用 Python 抓取知乎上的电影话题https://www.zhihu.com/topic/19550429/top-answers和影视话题https://www.zhihu.com/topic/19554706/top-answer">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-e47728d662fd04b5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-61180b1195adec62.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-602f04dcfc82a597.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-193a15586206ee66.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-b55700acff3f0d35.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-3e5df084bde54f2d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-46fc5802a8395464.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-03bffb5393329bc7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-89b8500cdd639401.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-3a25164b1aedae81.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-d4c58b5d11e909be.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-040cbe4d8113afe7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-c3785b2c5a475693.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-57336b91c8315d4f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-051ac4e1bded91fd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-7b815a3a0a0a27c5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-876353fa8cd6e6fa.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-7e2f42f0ccbb41ec.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-4cbf671091fe5f39.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-3ed0412fb5b7d9aa.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-0b370f2cde78c63a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-235f81dd596e0c5e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-28027550cb51f2ce.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/23152173-e1d4c6f426d2c39d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/17817191-9d41aa25edcd25c4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/17817191-6e0079f95d4c0338.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:updated_time" content="2020-10-16T11:50:40.680Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Python抓取知乎电影话题下万千网友推荐的电影，这个国庆节不愁没电影看了">
<meta name="twitter:description" content="苏生不惑第179 篇原创文章，将本公众号设为星标，第一时间看最新文章。  国庆假期第3天，你在家宅还是在外出游玩呢，如果在家无聊推荐几部经典电影给你看看。 这里用 Python 抓取知乎上的电影话题https://www.zhihu.com/topic/19550429/top-answers和影视话题https://www.zhihu.com/topic/19554706/top-answer">
<meta name="twitter:image" content="https://upload-images.jianshu.io/upload_images/23152173-e47728d662fd04b5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2020/10/16/Python抓取知乎电影话题下万千网友推荐的电影，这个国庆节不愁没电影看了/">



<meta name="referrer" content="never"> ​​​​


  <title>Python抓取知乎电影话题下万千网友推荐的电影，这个国庆节不愁没电影看了 | 苏生不惑的博客</title>
  








</head>

<body itemscope="" itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope="" itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">苏生不惑的博客</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br>
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off" placeholder="搜索..." spellcheck="false" type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/10/16/Python抓取知乎电影话题下万千网友推荐的电影，这个国庆节不愁没电影看了/">

    <span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
      <meta itemprop="name" content="苏生不惑">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="苏生不惑的博客">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Python抓取知乎电影话题下万千网友推荐的电影，这个国庆节不愁没电影看了</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2020-10-16T19:47:09+08:00">
                2020-10-16
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          
            <span class="post-meta-divider">|</span>
            <span class="page-pv"><i class="fa fa-file-o"></i>
            <span class="busuanzi-value" id="busuanzi_value_page_pv"></span>次
            </span>
          

          
            <div class="post-wordcount">
              
                
                  <span class="post-meta-divider">|</span>
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                <span title="字数统计">
                  6k 字
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                <span title="阅读时长">
                  21 分钟
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <blockquote>
<p>苏生不惑第179 篇原创文章，将本公众号设为<code>星标</code>，第一时间看最新文章。</p>
</blockquote>
<p>国庆假期第3天，你在家宅还是在外出游玩呢，如果在家无聊推荐几部经典电影给你看看。</p>
<p>这里用 Python 抓取知乎上的电影话题<a href="https://www.zhihu.com/topic/19550429/top-answers" target="_blank" rel="noopener">https://www.zhihu.com/topic/19550429/top-answers</a><br>和影视话题<a href="https://www.zhihu.com/topic/19554706/top-answers" target="_blank" rel="noopener">https://www.zhihu.com/topic/19554706/top-answers</a> 下回答人数多的几个问题，并提取回答中提及电影次数前50的电影。<br><img src="https://upload-images.jianshu.io/upload_images/23152173-e47728d662fd04b5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"></p>
<p>问题： 如果给你30秒让你说出三部你觉得最好的电影，会是哪三部 <a href="https://www.zhihu.com/question/369042910，13202个回答中提及电影次数最高前50的电影为：" target="_blank" rel="noopener">https://www.zhihu.com/question/369042910，13202个回答中提及电影次数最高前50的电影为：</a></p>
<p>肖申克的救赎, 霸王别姬, 阿甘正传, 怦然心动, 海上钢琴师, 泰坦尼克号, 星际穿越, 美丽人生, 当幸福来敲门, 教父, 绿皮书, 千与千寻, 让子弹飞, 这个杀手不太冷, 楚门的世界, 活着, 三傻大闹宝莱坞, 我不是药神, 盗梦空间, 少年的你, 辛德勒的名单, 放牛班的春天, 寄生虫, 大话西游, 傲慢与偏见,哈利波特, 忠犬八公的故事, 流浪地球, 乱世佳人, 末代皇帝, 触不可及, 你的名字，何以为家, 功夫, 看不见的客人, 黑客帝国, 寻梦环游记, 爱乐之城, 心灵捕手, 情书, 死亡诗社, 釜山行, 指环王, 无间道, 美国往事, 闻香识女人, 请以你的名字呼唤我, 低俗小说, 大鱼。</p>
<p>Python生成的饼图<br><img src="https://upload-images.jianshu.io/upload_images/23152173-61180b1195adec62.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"></p>
<p>问题：有哪些你看过五遍以上的电影？<a href="https://www.zhihu.com/question/31537241" target="_blank" rel="noopener">https://www.zhihu.com/question/31537241</a> ，22664个回答中提及电影次数最高前50的电影为：</p>
<p>肖申克的救赎,  霸王别姬,  阿甘正传,  千与千寻,  大话西游,  怦然心动,  教父,  泰坦尼克号,  让子弹飞, 海上钢琴师,  这个杀手不太冷,  三傻大闹宝莱坞,  功夫,  星际穿越,  盗梦空间,  初恋这件小事,  当幸福来敲门,  傲慢与偏见,  无间道,  情书,  龙猫,  哈尔的移动城堡,  哈利波特,  美国往事,  楚门的世界,  不能说的秘密,  唐伯虎点秋香,  喜剧之王,  东邪西毒,  美丽人生,  活着,  东成西就,  触不可及,  夏洛特烦恼,小森林,  黑客帝国,  闻香识女人,  一一,  真爱至上,  乱世佳人,  重庆森林,  你的名字,  放牛班的春天,低俗小说,  罗马假日,  搏击俱乐部,  天使爱美丽,  西西里的美丽传说,  辛德勒的名单,  天堂电影院。</p>
<p>Python生成的饼图<br><img src="https://upload-images.jianshu.io/upload_images/23152173-602f04dcfc82a597.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"><br>问题：有哪些电影一定要趁年轻看？<a href="https://www.zhihu.com/question/25699277，5355个回答中提及电影次数最高前50的电影为：" target="_blank" rel="noopener">https://www.zhihu.com/question/25699277，5355个回答中提及电影次数最高前50的电影为：</a></p>
<p>肖申克的救赎,  阿甘正传,  当幸福来敲门,  怦然心动,  三傻大闹宝莱坞,  死亡诗社,  霸王别姬,  教父,  心灵捕手,  楚门的世界,  海上钢琴师,  放牛班的春天,  泰坦尼克号,  阳光灿烂的日子,  情书,  风雨哈佛路,美丽人生,  千与千寻,  熔炉,  垫底辣妹,  这个杀手不太冷,  美丽心灵,  搏击俱乐部,  爆裂鼓手,  西西里的美丽传说,  闻香识女人,  初恋这件小事,  美国往事,  白日梦想家,  大鱼,  星际穿越,  活着,  阳光姐妹淘,傲慢与偏见,  天堂电影院,  猜火车,  辛德勒的名单,  喜剧之王,  一一,  盗梦空间,  穿普拉达的女王,  被嫌弃的松子的一生,  大话西游,  触不可及,  罗马假日,  忠犬八公的故事,  假如爱有天意,  饮食男女,  天使爱美丽,  牯岭街少年杀人事件。</p>
<p>Python生成的饼图<br><img src="https://upload-images.jianshu.io/upload_images/23152173-193a15586206ee66.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"><br>问题：有哪些好看到让人无法自拔、久久不忘的电影？<a href="https://www.zhihu.com/question/38485891，12240个回答中提及电影次数最高前50的电影为：" target="_blank" rel="noopener">https://www.zhihu.com/question/38485891，12240个回答中提及电影次数最高前50的电影为：</a></p>
<p>肖申克的救赎,  熔炉,  霸王别姬,  海上钢琴师,  阿甘正传,  教父,  这个杀手不太冷,  辩护人,  素媛,  星际穿越,  告白,  泰坦尼克号,  怦然心动,  搏击俱乐部,  楚门的世界,  美国往事,  美丽人生,  杀人回忆,狩猎,  活着,  情书,  西西里的美丽传说,  爆裂鼓手,  被嫌弃的松子的一生,  盗梦空间,  恐怖直播,  当幸福来敲门,  辛德勒的名单,  超脱,  无间道,  死亡诗社,  大话西游,  梦之安魂曲,  勇敢的心,  香水,  控方证人,  消失的爱人,  闻香识女人,  穿条纹睡衣的男孩,  低俗小说,  三傻大闹宝莱坞,  触不可及,  忠犬八公的故事,  天堂电影院,  万能钥匙,  禁闭岛,  断背山,  十二公民,  美丽心灵,  恐怖游轮。<br><img src="https://upload-images.jianshu.io/upload_images/23152173-b55700acff3f0d35.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"><br>问题：如果让你向别人推荐十部电影，你会推荐哪十部？<a href="https://www.zhihu.com/question/281185483" target="_blank" rel="noopener">https://www.zhihu.com/question/281185483</a> ，5820个回答中提及电影次数最高前50的电影为：</p>
<p>肖申克的救赎,  霸王别姬,  阿甘正传,  泰坦尼克号,  当幸福来敲门,  教父,  怦然心动,  海上钢琴师,  这个杀手不太冷,  美丽人生,  千与千寻,  活着,  楚门的世界,  星际穿越,  辛德勒的名单,  盗梦空间,  三傻大闹宝莱坞,  放牛班的春天,  我不是药神,  熔炉,  无间道,  低俗小说,  大话西游,  让子弹飞,  西西里的美丽传说,  闻香识女人,  忠犬八公的故事,  美国往事,  死亡诗社,  情书,  心灵捕手,  寻梦环游记,  末代皇帝,看不见的客人,  罗马假日,  天堂电影院,  绿皮书,  重庆森林,  乱世佳人,  被嫌弃的松子的一生,  少年派的奇幻漂流,  阳光灿烂的日子,  触不可及,  拯救大兵瑞恩,  何以为家,  小森林,  断背山,  十二怒汉,  釜山行,  素媛。</p>
<p>Python生成的饼图<br><img src="https://upload-images.jianshu.io/upload_images/23152173-3e5df084bde54f2d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"><br>问题：有什么高分好看的电影推荐？<a href="https://www.zhihu.com/question/342727398，1467个回答中提及电影次数最高前50的电影为：" target="_blank" rel="noopener">https://www.zhihu.com/question/342727398，1467个回答中提及电影次数最高前50的电影为：</a></p>
<p>肖申克的救赎,  霸王别姬,  美丽人生,  阿甘正传,  寄生虫,  绿皮书,  泰坦尼克号,  海上钢琴师,  楚门的世界,  当幸福来敲门,  何以为家,  怦然心动,  这个杀手不太冷,  盗梦空间,  千与千寻,  辛德勒的名单,  少年的你,  小丑,  教父,  星际穿越,  我不是药神,  放牛班的春天,  婚姻故事,  误杀,  三傻大闹宝莱坞,  忠犬八公的故事,  爱尔兰人,  触不可及,  哪吒之魔童降世,  美国往事,  闻香识女人,  天堂电影院,  熔炉,  辩护人,  流浪地球,  罗马假日,  乱世佳人,  情书,  看不见的客人,  调音师,  小鞋子,  罗小黑战记,  活着,  穿条纹睡衣的男孩,  控方证人,  搏击俱乐部,  海蒂和爷爷,  西西里的美丽传说,  饮食男女,  了不起的盖茨比。</p>
<p>Python生成的饼图<br><img src="https://upload-images.jianshu.io/upload_images/23152173-46fc5802a8395464.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"><br>问题：如果只能推荐两部电影你会推荐哪两部<a href="https://www.zhihu.com/question/368550554，1321个回答中提及电影次数最高前50的电影为：" target="_blank" rel="noopener">https://www.zhihu.com/question/368550554，1321个回答中提及电影次数最高前50的电影为：</a></p>
<p>肖申克的救赎,  阿甘正传,  霸王别姬,  海上钢琴师,  泰坦尼克号,  当幸福来敲门,  这个杀手不太冷,  星际穿越,  寄生虫,  美丽人生,  怦然心动,  大鱼,  活着,  小丑,  辛德勒的名单,  千与千寻,  乱世佳人,  楚门的世界,  教父,  爱乐之城,  末代皇帝,  活埋,  美国往事,  何以为家,  白日梦想家,  让子弹飞,  小森林,调音师,  我不是药神,  傲慢与偏见,  一一,  天使爱美丽,  放牛班的春天,  盗梦空间,  布达佩斯大饭店,  情书,  了不起的盖茨比,  请以你的名字呼唤我,  大话西游,  绿皮书,  忠犬八公的故事,  饮食男女,  寻梦环游记,  出租车司机,  看不见的客人,  守望者,  春光乍泄,  菊次郎的夏天,  小鞋子,  触不可及。</p>
<p>Python生成的饼图<br><img src="https://upload-images.jianshu.io/upload_images/23152173-03bffb5393329bc7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"><br>问题：有哪些爆笑恶搞能把人笑爆炸的电影值得推荐 <a href="https://www.zhihu.com/question/36918815，1685个回答中提及电影次数最高前50的电影为：" target="_blank" rel="noopener">https://www.zhihu.com/question/36918815，1685个回答中提及电影次数最高前50的电影为：</a></p>
<p>惊声尖笑,  独裁者,  你丫闭嘴,  东成西就,  宿醉,  白头神探,  电影43,  僵尸肖恩,  三傻大闹宝莱坞,  波拉特,  小姐好白,  蜻蜓侠,  上帝也疯狂,  这不是斯巴达,  两杆大烟枪,  洋葱电影,  夏洛特烦恼,  买凶拍人,  虎口脱险,  美国派,  超级英雄,  冒牌家庭,  空前绝后满天飞,  葬礼上的死亡,  王牌贱谍,  冒牌天神,女间谍,  反斗神鹰,  热情似火,  IT狂人,  预产期,  龙虎少年队,  暮光之城,  巨蟒与圣杯,  神探飞机头,唐伯虎点秋香,  笑破铁幕,  变相怪杰,  热血警探,  低俗小说,  我为玛丽狂,  挨饿游戏,  世界尽头,  暮色大电影,  斯巴达300勇士,  疯狂的赛车,  变态假面,  世界末日,  微不足道,  九品芝麻官。</p>
<p>Python生成的饼图<br><img src="https://upload-images.jianshu.io/upload_images/23152173-89b8500cdd639401.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"><br>问题：有哪些优秀的、「燃到爆」的电影？ <a href="https://www.zhihu.com/question/48035752，1505个回答中提及电影次数最高前50的电影为：" target="_blank" rel="noopener">https://www.zhihu.com/question/48035752，1505个回答中提及电影次数最高前50的电影为：</a></p>
<p>爆裂鼓手,  速度与激情,  英雄本色,  王牌特工,  突袭,  勇士,  热血高校,  铁甲钢拳,  谍影重重,  搏击俱乐部,  暴力街区,  激战,  飓风营救,  肖申克的救赎,  垫底辣妹,  热血警探,  怒火攻心,  白日梦想家,  飞鹰艾迪,  十三刺客,  杀破狼,  安娜,  疾速追杀,  叶问,  海盗电台,  硬核亨利,  夏日大作战,  疾速特攻,杀死比尔,  极盗者,  恐怖直播,  V字仇杀队,  功之怒,  碟中谍,  惊天魔盗团,  勇敢的心,  战狼2,  环太平洋,  洛奇,  当幸福来敲门,  大叔,  赛德克巴莱,  极速风流,  湄公河行动,  终极斗士,  复联4,  这个杀手不太冷,  孤胆特工,  勇闯夺命岛,  疯狂的麦克斯：狂暴之路。</p>
<p>Python生成的饼图<br><img src="https://upload-images.jianshu.io/upload_images/23152173-3a25164b1aedae81.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"></p>
<p>问题：你心目中的香港电影十佳是哪些？<a href="https://www.zhihu.com/question/19809033，550个回答中提及电影次数最高前50的电影为：" target="_blank" rel="noopener">https://www.zhihu.com/question/19809033，550个回答中提及电影次数最高前50的电影为：</a></p>
<p>无间道,  英雄本色,  大话西游,  东邪西毒,  甜蜜蜜,  倩女幽魂,  春光乍泄,  阿飞正传,  枪火,  纵横四海,  花样年华,  喜剧之王,  东成西就,  新龙门客栈,  重庆森林,  黑社会,  青蛇,  暗战,  功夫,  胭脂扣,  古惑仔,  赌神,  秋天的童话,  桃姐,  暗花,  阿郎的故事,  霸王别姬,  神探,  志明与春娇,  喋血双雄,  警察故事,  岁月神偷,  笑傲江湖,  精武英雄,  唐伯虎点秋香,  A计划,  监狱风云,  家有喜事,  东方不败,  无间道2,  黄飞鸿,  买凶拍人,  天水围的日与夜,  精武门,  僵尸先生,  女人四十,  黑金,  跛豪,  喋血街头,<br>跟踪。</p>
<p>Python生成的饼图<br><img src="https://upload-images.jianshu.io/upload_images/23152173-d4c58b5d11e909be.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"></p>
<p>问题：有哪些好看的韩国电影值得推荐 <a href="https://www.zhihu.com/question/35685110，843个回答中提及电影次数最高前50的电影为：" target="_blank" rel="noopener">https://www.zhihu.com/question/35685110，843个回答中提及电影次数最高前50的电影为：</a></p>
<p>熔炉,  辩护人,  素媛,  杀人回忆,  恐怖直播,  釜山行,  七号房的礼物,  假如爱有天意,  新世界,  黄海,追击者,  老男孩,  阳光姐妹淘,  与神同行,  我的野蛮女友,  流感,  暗杀,  汉江怪物,  隐秘而伟大,  狼少年,  奇怪的她,  建筑学概论,  我爱你,  铁线虫入侵,  卑劣的街头,  小姐,  寄生虫,  出租车司机,  隧道,雏菊,  老手,  亲切的金子,  太极旗飘扬,  金福南杀人事件始末,  开心家族,  雪国列车,  欢迎来到东莫村,人间中毒,  孤胆特工,  空房间,  国际市场,  看见恶魔,  特工,  思悼,  内在美,  大叔,  霜花店,  八月照相馆,  共同警备区,  回家的路。</p>
<p>Python生成的饼图<br><img src="https://upload-images.jianshu.io/upload_images/23152173-040cbe4d8113afe7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"></p>
<p>问题：你认为哪些华语电影是被严重低估的 <a href="https://www.zhihu.com/question/20826845，972个回答中提及电影次数最高前50的电影为：" target="_blank" rel="noopener">https://www.zhihu.com/question/20826845，972个回答中提及电影次数最高前50的电影为：</a></p>
<p>英雄,  无极,  大明劫,  不能说的秘密,  万箭穿心,  落叶归根,  剑雨,  投名状,  道士下山,  黄土地,  中邪,  半生缘,  十月围城,  魁拔,  唐探,  闪光少女,  心花路放,  绣春刀,  独自等待,  情圣,  无人区,  唐探2,  天狗,  一一,  妖猫传,  杀生,  王的盛宴,  霸王别姬,  心迷宫,  满城尽带黄金甲,  无间道,  天注定,斗牛,  阿飞正传,  建党伟业,  蜀山传,  三峡好人,  双瞳,  夜宴,  功夫,  牯岭街,  紫日,  喜剧之王,  狗十三,  一代宗师,  诡丝,  我们俩,  有话好好说,  钢的琴,  烈日灼心。</p>
<p>Python生成的饼图<br><img src="https://upload-images.jianshu.io/upload_images/23152173-c3785b2c5a475693.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"></p>
<p>问题：有哪些搞笑又发人深省的电影<a href="https://www.zhihu.com/question/49560603，436个回答中提及电影次数最高前50的电影为：" target="_blank" rel="noopener">https://www.zhihu.com/question/49560603，436个回答中提及电影次数最高前50的电影为：</a></p>
<p>驴得水,  三傻大闹宝莱坞,  大话西游,  三傻,  喜剧之王,  唐人街探案,  唐伯虎点秋香,  杀生,  人生遥控器,  夏洛特烦恼,  PK,  逃狱三王,  美人鱼,  触不可及,  阿甘正传,  盗钥匙的方法,  被嫌弃的松子的一生,我的个神啊,  城市之光,  奇怪的她,  一个叫欧维的男人决定去死,  我是好人,  大话王,  我的野蛮女友,  落叶归根,  让子弹飞,  美丽人生,  阳光姐妹淘,  一念天堂,  一个勺子,  重返二十岁,  甲方乙方,  你逃我也逃,  芳华,  疯狂动物城,  白日梦想家,  功夫,  鬼子来了,  Keep on the sunny side,  九品芝麻官,  青春派, 垫底辣妹,  那些年,  三个傻瓜,  飞跃疯人院,  初恋这件小事,  交响人生,  奶奶强盗团,  三毛从军记,  两杆大烟枪。</p>
<p>Python生成的饼图<br><img src="https://upload-images.jianshu.io/upload_images/23152173-57336b91c8315d4f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"></p>
<p>问题：有哪些好看的高智商悬疑电影 <a href="https://www.zhihu.com/question/35811067，2044个回答中提及电影次数最高前50的电影为：" target="_blank" rel="noopener">https://www.zhihu.com/question/35811067，2044个回答中提及电影次数最高前50的电影为：</a></p>
<p>禁闭岛,  看不见的客人,  恐怖游轮,  盗梦空间,  穆赫兰道,  致命ID,  万能钥匙,  记忆碎片,  彗星来的那一夜,  致命魔术,  蝴蝶效应,  消失的爱人,  七宗罪,  沉默的羔羊,  搏击俱乐部,  控方证人,  非常嫌疑犯,前目的地,  心迷宫,  神探,  电锯惊魂,  第六感,  源代码,  调音师,  一级恐惧,  小岛惊魂,  黑暗面,  越狱,  神探夏洛克,  时空罪恶,  未麻的部屋,  杀人回忆,  生死停留,  告白,  机械师,  惊天魔盗团,  猫鼠游戏,  误杀瞒天记,  孤儿怨,  迷雾,  海市蜃楼,  汉尼拔,  死亡幻觉,  守法公民,  无人生还,  追随,  催眠大师,  红辣椒,  无双,  香水。</p>
<p>Python生成的饼图<br><img src="https://upload-images.jianshu.io/upload_images/23152173-051ac4e1bded91fd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"></p>
<p>问题：有没有一部可以让人痛哭流涕的电影<a href="https://www.zhihu.com/question/343259251，2466个回答中提及电影次数最高前50的电影为：" target="_blank" rel="noopener">https://www.zhihu.com/question/343259251，2466个回答中提及电影次数最高前50的电影为：</a></p>
<p>忠犬八公的故事,  七号房的礼物,  忠犬八公,  素媛,  何以为家,  熔炉,  我不是药神,  妈妈再爱我一次,  被嫌弃的松子的一生,  婚纱,  少年的你,  美丽人生,  泰坦尼克号,  我爱你,  萤火虫之墓,  海上钢琴师,  岁月神偷,  唐山大地震,  我是山姆,  霸王别姬,  我和我的祖国,  一条狗的使命,  寻梦环游记,  假如爱有天意,大话西游,  完美的世界,  开心家族,  比悲伤更悲伤的故事,  我脑海中的橡皮擦,  亲爱的,  天堂电影院,  遇见你之前,  狼少年,  情书,  当幸福来敲门,  暖春,  穿条纹睡衣的男孩,  无问西东,  活着,  悲伤逆流成河, 人狗奇缘,  人工智能,  死亡诗社,  全民目击,  金陵十三钗,  这个杀手不太冷,  小偷家族,  阿甘正传,  烈火英雄,  肖申克的救赎。</p>
<p>Python生成的饼图<br><img src="https://upload-images.jianshu.io/upload_images/23152173-7b815a3a0a0a27c5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"></p>
<p>问题：让你感动到哭的电影是什么 <a href="https://www.zhihu.com/question/24946395，1453个回答中提及电影次数最高前50的电影为：" target="_blank" rel="noopener">https://www.zhihu.com/question/24946395，1453个回答中提及电影次数最高前50的电影为：</a></p>
<p>忠犬八公,  素媛,  七号房的礼物,  忠犬八公的故事,  当幸福来敲门,  美丽人生,  死亡诗社,  婚纱,  泰坦尼克号,  妈妈再爱我一次,  被嫌弃的松子的一生,  狼少年,  熔炉,  霸王别姬,  肖申克的救赎,  唐山大地震,阿甘正传,  釜山行,  天堂电影院,  假如爱有天意,  黑太阳731,  海上钢琴师,  入殓师,  这个杀手不太冷,亲爱的,  海洋天堂,  飞屋环游记,  我爱你,  岁月神偷,  萤火虫之墓,  初恋这件小事,  大话西游,  人工智能,  情书,  窃听风暴,  三傻大闹宝莱坞,  活着,  美丽心灵,  归来,  小萝莉的猴神大叔,  寻梦环游记,  完美的世界,  开心鬼上身,  外婆的家,  暖春,  勇敢的心,  小鞋子,  雏菊,  血战钢锯岭,  辛德勒的名单。</p>
<p>Python生成的饼图<br><img src="https://upload-images.jianshu.io/upload_images/23152173-876353fa8cd6e6fa.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"></p>
<p>问题：有没有一部电影让你在深夜中痛哭 <a href="https://www.zhihu.com/question/37206525，19105个回答中提及电影次数最高前50的电影为：" target="_blank" rel="noopener">https://www.zhihu.com/question/37206525，19105个回答中提及电影次数最高前50的电影为：</a></p>
<p>忠犬八公,  七号房的礼物,  素媛,  被嫌弃的松子的一生,  熔炉,  婚纱,  忠犬八公的故事,  霸王别姬,  海上钢琴师,  岁月神偷,  萤火虫之墓,  大话西游,  初恋这件小事,  这个杀手不太冷,  泰坦尼克号,  假如爱有天意,  当幸福来敲门,  狼少年,  我爱你,  美丽人生,  我的少女时代,  入殓师,  情书,  断背山,  肖申克的救赎,  死亡诗社,  狩猎,  开心家族,  恋恋笔记本,  亲爱的,  天堂电影院,  垫底辣妹,  喜剧之王,  穿条纹睡衣的男孩,  阿甘正传,  比悲伤更悲伤的故事,  妈妈再爱我一次,  唐山大地震,  阳光姐妹淘,  辩护人,  辛德勒的名单,  one day,  暖春,  完美的世界,  秒速五厘米,  人工智能,  星际穿越,  活着,  蓝宇,  雏菊。</p>
<p>Python生成的饼图<br><img src="https://upload-images.jianshu.io/upload_images/23152173-7e2f42f0ccbb41ec.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"></p>
<p>问题：有哪些看完可以让人热血沸腾的动作片推荐？ <a href="https://www.zhihu.com/question/27855422，503个回答中提及电影次数最高前50的电影为：" target="_blank" rel="noopener">https://www.zhihu.com/question/27855422，503个回答中提及电影次数最高前50的电影为：</a></p>
<p>谍影重重,  杀破狼,  疾速追杀,  热血高校,  突袭,  狼牙,  第一滴血,  洛奇,  敢死队,  速度与激情,  导火线,  叶问,  激战,  勇士,  John Wick,  虎胆龙威,  空中监狱,  机械师,  疾速备战,  这个杀手不太冷,  精武英雄,  疾速特攻,  非常人贩,  战狼,  力王,  伸冤人,  特工绍特,  勇闯夺命岛,  功夫,  杀死比尔,  刺客联盟,  暴力街区,  飓风营救,  拳霸,  绣春刀,  飓风营救1,  终极斗士,  怒火攻心,  变脸,  怒火救援,  藏身之所,  功夫宗师霍元甲,  霍元甲,  碟中谍,  斯巴达克斯,  反击,  疯狂的麦克斯4：狂暴之路,  黑客帝国,<br> 卑劣的街头,  极限特工。</p>
<p>Python生成的饼图<br><img src="https://upload-images.jianshu.io/upload_images/23152173-4cbf671091fe5f39.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"></p>
<p>问题：有没有什么演员演技炸裂的电视剧或电影？ <a href="https://www.zhihu.com/question/337052769，343个回答中提及电影次数最高前50的电影为：" target="_blank" rel="noopener">https://www.zhihu.com/question/337052769，343个回答中提及电影次数最高前50的电影为：</a></p>
<p>霸王别姬,  我的团长我的团,  白夜追凶,  鸡毛飞上天,  黑社会,  琅琊榜,  如懿传,  战长沙,  香蜜沉沉烬如霜,  长安十二时辰,  陈情令,  镇魂,  蓝色茉莉,  都挺好,  加油你是最棒的,  当幸福来敲门,  士兵突击,何以为家,  英雄本色,  伪装者,  烈日灼心,  枪王,  春光乍泄,  孤儿怨,  杀人回忆,  归来,  天道,  我的前半生,  釜山行,  父母爱情,  大明王朝1566,  绿皮书,  柒个我,  致命女人,  武林外传,  万箭穿心,  沙海,甄嬛传,  一把青,  我们与恶的距离,  老酒馆,  东宫,  杀死伊芙,  小委托人,  熔炉,  芈月传,  请回答1988,  人民的名义,  轮到你了,  信号。</p>
<p>Python生成的饼图<br><img src="https://upload-images.jianshu.io/upload_images/23152173-3ed0412fb5b7d9aa.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"></p>
<p>问题：有哪部电影让你受益良多？ <a href="https://www.zhihu.com/question/303835412，2374个回答中提及电影次数最高前50的电影为：" target="_blank" rel="noopener">https://www.zhihu.com/question/303835412，2374个回答中提及电影次数最高前50的电影为：</a></p>
<p>肖申克的救赎,  阿甘正传,  当幸福来敲门,  教父,  三傻大闹宝莱坞,  怦然心动,  海上钢琴师,  霸王别姬,美丽人生,  死亡诗社,  一一,  大鱼,  楚门的世界,  我不是药神,  垫底辣妹,  千与千寻,  无问西东,  活着,  乱世佳人,  被嫌弃的松子的一生,  搏击俱乐部,  泰坦尼克号,  白日梦想家,  心灵捕手,  辛德勒的名单,步履不停,  邪不压正,  狗十三,  返老还童,  美国往事,  闻香识女人,  了不起的盖茨比,  忠犬八公的故事,这个杀手不太冷,  触不可及,  放牛班的春天,  海街日记,  星际穿越,  天堂电影院,  熔炉,  寻梦环游记,  时空恋旅人,  悲伤逆流成河,  大话西游,  超脱,  东邪西毒,  小偷家族,  何以为家,  本杰明·巴顿奇事,  西西里的美丽传说。</p>
<p>Python生成的饼图<br><img src="https://upload-images.jianshu.io/upload_images/23152173-0b370f2cde78c63a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"><br>最后将上面所有问题提及的电影生成的文件合并统计。<br><img src="https://upload-images.jianshu.io/upload_images/23152173-235f81dd596e0c5e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"></p>
<p>代码如下：</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> os</span><br><span class="line"><span class="keyword">import</span> pandas <span class="keyword">as</span> pd</span><br><span class="line"><span class="keyword">import</span> numpy <span class="keyword">as</span> np</span><br><span class="line"><span class="keyword">import</span> glob</span><br><span class="line"><span class="keyword">from</span> pyecharts <span class="keyword">import</span> options <span class="keyword">as</span> opts</span><br><span class="line"><span class="keyword">from</span> pyecharts.charts <span class="keyword">import</span> Bar</span><br><span class="line"><span class="keyword">from</span> pyecharts.charts <span class="keyword">import</span> Pie</span><br><span class="line"><span class="keyword">from</span> wordcloud <span class="keyword">import</span> WordCloud</span><br><span class="line"><span class="keyword">import</span> matplotlib.pyplot <span class="keyword">as</span> plt</span><br><span class="line">frames = []</span><br><span class="line"><span class="keyword">for</span> root, dirs, files <span class="keyword">in</span> os.walk(<span class="string">'.'</span>):</span><br><span class="line">	<span class="keyword">for</span> file <span class="keyword">in</span> files:</span><br><span class="line">		<span class="keyword">if</span> file.endswith(<span class="string">'.csv'</span>):</span><br><span class="line">			print(os.path.join(root,file))</span><br><span class="line">			df = pd.read_csv(os.path.join(root,file))</span><br><span class="line">			frames.append(df)</span><br><span class="line">#合并所有数据</span><br><span class="line">result = pd.concat(frames)</span><br><span class="line">result=result.replace('忠犬八公的故事','忠犬八公')#df.replace(&#123;'B':'E','C':'F'&#125;)</span><br><span class="line">df=result.groupby(<span class="string">'name'</span>).agg(<span class="string">'sum'</span>)</span><br><span class="line">df.sort_values(by=[<span class="string">'counts'</span>], ascending=False, inplace=True)</span><br><span class="line">print(df.head(<span class="number">50</span>))</span><br><span class="line">names = df[<span class="string">'name'</span>].head(<span class="number">50</span>).tolist()</span><br><span class="line">counts = df[<span class="string">'counts'</span>].head(<span class="number">50</span>).tolist()</span><br><span class="line">df.head(<span class="number">50</span>).to_csv(<span class="string">'res.csv'</span>,encoding=<span class="string">"utf_8_sig"</span>)</span><br><span class="line">bar = (</span><br><span class="line">    Bar()</span><br><span class="line">        .add_xaxis(names)</span><br><span class="line">        .add_yaxis(<span class="string">""</span>, counts)</span><br><span class="line">)</span><br><span class="line">bar.render(<span class="string">'bar.html'</span>)</span><br><span class="line">pie = (</span><br><span class="line">    Pie()</span><br><span class="line">    .add(<span class="string">""</span>, [list(z) <span class="keyword">for</span> z <span class="keyword">in</span> zip(names, counts)],radius=[<span class="string">"40%"</span>, <span class="string">"75%"</span>], )</span><br><span class="line">    .set_global_opts(title_opts=opts.TitleOpts(title=<span class="string">"饼图"</span>,pos_left=<span class="string">"center"</span>,pos_top=<span class="string">"20"</span>))</span><br><span class="line">    .set_global_opts(legend_opts=opts.LegendOpts(type_=<span class="string">"scroll"</span>, pos_left=<span class="string">"80%"</span>, orient=<span class="string">"vertical"</span>))</span><br><span class="line">    .set_series_opts(label_opts=opts.LabelOpts(formatter=<span class="string">"&#123;b&#125;: &#123;d&#125;%"</span>), )</span><br><span class="line">)</span><br><span class="line">pie.render(<span class="string">'pie.html'</span>)</span><br></pre></td></tr></table></figure>
<p>统计出前50的电影列表：</p>
<p>肖申克的救赎, 霸王别姬, 阿甘正传, 海上钢琴师, 怦然心动, 泰坦尼克号, 当幸福来敲门, 教父, 这个杀手不太冷, 美丽人生, 大话西游, 千与千寻, 星际穿越, 熔炉, 三傻大闹宝莱坞, 楚门的世界, 盗梦空间, 活着, 素媛, 忠犬八公的故事, 被嫌弃的松子的一生, 辛德勒的名单, 无间道, 七号房的礼物, 情书, 让子弹飞, 放牛班的春天, 初恋这件小事, 死亡诗社, 美国往事, 我不是药神, 搏击俱乐部, 心灵捕手, 西西里的美丽传说,天堂电影院, 闻香识女人, 喜剧之王, 假如爱有天意, 傲慢与偏见, 绿皮书, 触不可及, 功夫, 辩护人, 乱世佳人, 看不见的客人, 大鱼, 东邪西毒, 低俗小说, 断背山。</p>
<p>Python生成的饼图可以看到电影《肖申克的救赎》以2951的提及次数遥遥领先，不愧为豆瓣电影 Top 250 排第一 <a href="https://movie.douban.com/top250" target="_blank" rel="noopener">https://movie.douban.com/top250</a> ，紧随其后的是张国荣《霸王别姬》。<br><img src="https://upload-images.jianshu.io/upload_images/23152173-28027550cb51f2ce.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"><br><img src="https://upload-images.jianshu.io/upload_images/23152173-e1d4c6f426d2c39d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"></p>
<p>如果想找以上电影看看之前文章<a href="https://mp.weixin.qq.com/s/0uOyrcz0KP-qZhCNNCELhw" target="_blank" rel="noopener">2020 最全百度网盘搜索，找电影资源不再愁</a> ，应该都能找到。</p>
<blockquote>
<p>大家的点赞和在看转发对我非常重要，如果文章对你有帮助还请支持下， 感谢各位！</p>
</blockquote>
<table>
<thead>
<tr>
<th>公众号后台回复关键词</th>
<th>用途</th>
</tr>
</thead>
<tbody>
<tr>
<td>微信</td>
<td>获取你的微信好友头像拼图及查看微信撤回消息</td>
</tr>
<tr>
<td>b站</td>
<td>获取下载b站视频工具及找回被删b站视频方法</td>
</tr>
<tr>
<td>视频</td>
<td>获取下载腾讯，优酷，爱奇艺，微博视频工具及去除logo脚本</td>
</tr>
<tr>
<td>百度网盘</td>
<td>获取加速下载网盘文件方法及查找电影电视剧网站</td>
</tr>
<tr>
<td>朋友圈</td>
<td>获取发空白朋友圈方法</td>
</tr>
<tr>
<td>微博</td>
<td>获取备份微博工具及分析微博账号数据</td>
</tr>
<tr>
<td>音乐</td>
<td>获取下载音乐工具及在线听歌网站</td>
</tr>
<tr>
<td>油猴</td>
<td>获取油猴脚本</td>
</tr>
<tr>
<td>谷歌</td>
<td>获取安装Chrome扩展方法</td>
</tr>
<tr>
<td>公众号</td>
<td>一键下载公众号所有文章</td>
</tr>
</tbody>
</table>
<p><img src="https://upload-images.jianshu.io/upload_images/17817191-9d41aa25edcd25c4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="免费知识星球，每天更新"></p>
<h3 id="公众号-苏生不惑"><a href="#公众号-苏生不惑" class="headerlink" title="公众号 苏生不惑"></a>公众号 苏生不惑</h3><p> <img src="https://upload-images.jianshu.io/upload_images/17817191-6e0079f95d4c0338.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="扫描二维码关注或搜索微信susheng_buhuo"></p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/公众号/" rel="tag"># 公众号</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2020/10/16/中秋-国庆节发福利了，小伙伴们来领现金红包/" rel="next" title="中秋/国庆节发福利了，小伙伴们来领现金红包">
                <i class="fa fa-chevron-left"></i> 中秋/国庆节发福利了，小伙伴们来领现金红包
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2020/10/16/集赞生成器：朋友圈集赞不求人/" rel="prev" title="集赞生成器：朋友圈集赞不求人">
                集赞生成器：朋友圈集赞不求人 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
          <div class="comments" id="comments">
             <div id="gitment-container"></div>
         </div>
  




        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope="" itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">苏生不惑</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">382</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">37</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/sushengbuhuo" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mysusheng@gmail.com" target="_blank" title="E-Mail">
                      
                        <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://plus.google.com/mysusheng" target="_blank" title="Google">
                      
                        <i class="fa fa-fw fa-google"></i>Google</a>
                  </span>
                
            </div>
          

          
          

          
          
            <div class="links-of-blogroll motion-element links-of-blogroll-block">
              <div class="links-of-blogroll-title">
                <i class="fa  fa-fw fa-link"></i>
                Links
              </div>
              <ul class="links-of-blogroll-list">
                
                  <li class="links-of-blogroll-item">
                    <a href="http://v2ex.com/" title="v2ex" target="_blank">v2ex</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.fanhaobai.com/" title="fanhaobai" target="_blank">fanhaobai</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://yuanxuxu.com/archives/" title="yuanxuxu" target="_blank">yuanxuxu</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.snail-c.cn/article" title="snail-c" target="_blank">snail-c</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://showcj.com/archives" title="showcj" target="_blank">showcj</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://vultr.aicnm.com/%E6%9C%80%E6%96%B0Vultr%E6%B3%A8%E5%86%8C%E5%8F%8AVPS%E8%B4%AD%E4%B9%B0%E5%9B%BE%E6%96%87%E6%95%99%E7%A8%8B/" title="vultr" target="_blank">vultr</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.lucissfer.com/" title="lucissfer" target="_blank">lucissfer</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://blog.csdn.net/fdipzone/article/details/79352685" title="傲雪星枫" target="_blank">傲雪星枫</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.yoby123.cn/index.php/category/default/" title="小白的分享" target="_blank">小白的分享</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.cnblogs.com/52fhy/p/5819995.html" title="PHP攻城狮" target="_blank">PHP攻城狮</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://blog.jiaojie.site/" title="php" target="_blank">php</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://sphard.com/archives/" title="sphard" target="_blank">sphard</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://yuanxuxu.com/archives/" title="LNMP技术栈笔记" target="_blank">LNMP技术栈笔记</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://www.coding10.com/" title="学习 Laravel" target="_blank">学习 Laravel</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://shuwoom.com/?page_id=929" title="区块链学习指南" target="_blank">区块链学习指南</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://greenlightt.github.io/archives/" title="greenlightt" target="_blank">greenlightt</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.0php.net/archives/" title="0php" target="_blank">0php</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://www.fordba.com/category/mysql" title="mysql" target="_blank">mysql</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.itcodemonkey.com/" title="程序员" target="_blank">程序员</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.yanshuo.me/r/v2ex" title="言说" target="_blank">言说</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.timiguo.com/archive.html" title="提米果的博客" target="_blank">提米果的博客</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://phpartisan.cn/news/112.html" title="phpartisan" target="_blank">phpartisan</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.cnblogs.com/52fhy/" title="飞鸿影" target="_blank">飞鸿影</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://www.54php.cn/" title="54php" target="_blank">54php</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.lazyman.vip/" title="营销" target="_blank">营销</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.njphper.com/archives/" title="做人呢最重要的就是开心" target="_blank">做人呢最重要的就是开心</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.h57.pw/" title="php 初心者" target="_blank">php 初心者</a>
                  </li>
                
              </ul>
            </div>
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#公众号-苏生不惑"><span class="nav-number">1.</span> <span class="nav-text">公众号 苏生不惑</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

<div class="copyright">&copy; <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">苏生不惑</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.4</div>



<div>
<span id="showDays"></span>

</div>

<span id="busuanzi_container_site_pv">
   总访问量:<span id="busuanzi_value_site_pv"></span>次
</span>



  <span class="post-meta-divider">|</span>



<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">博客全站共773.8k字</span>
</div>
<script>
var birthDay = new Date("11/20/2018");
var now = new Date();
var duration = now.getTime() - birthDay.getTime();
var total= Math.floor(duration / (1000 * 60 * 60 * 24));
document.getElementById("showDays").innerHTML = "本站已运行 "+total+" 天";
</script>

        
<div class="busuanzi-count">
  <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv">
      <i class="fa fa-user"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
      人次
    </span>
  

  
    <span class="site-pv">
      <i class="fa fa-eye"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
      次
    </span>
  
</div>








        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  











  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  

  
  
    <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  











<script type="text/javascript">
    (function() {
        // 匿名函数，防止污染全局变量
        var utterances = document.createElement('script');
        utterances.type = 'text/javascript';
        utterances.async = true;
        utterances.setAttribute('issue-term','0')
        utterances.setAttribute('theme','')
        utterances.setAttribute('repo','sushengbuhuo/laravel_ioc_demo')
        utterances.crossorigin = 'anonymous';
        utterances.src = 'https://utteranc.es/client.js';
        // content 是要插入评论的地方
        document.getElementById('gitment-container').appendChild(utterances);
    })();
</script>


  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  

  

  
  

  

  

  

  
<script>
  ((window.gitter = {}).chat = {}).options = {
    //room替换成自己的聊天室名称即可，room的名称规则是：username/roomname
    room: 'sushengbuhuo-chat/mychat'
  };
</script>
<script src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer></script>

</body>
</html>
